<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // function Person(name) {
        //    this.name=name
        // }
        // Person.prototype.getName=function(){
        //     return this.name
        // }
        // function Student(name) {
        //     Person.apply(this,arguments)
        // }
        // const person=new Person('zhi')
        // Student.prototype=new Person('nb')
        // const student=new Student('zou')
        // console.log(student,person)
        // console.log(Student.prototype)
        // Student.prototype=new Person('zou') 
        // Student.prototype.constructor=Student
        // console.log(Student.prototype)
        function A(...data){
            console.log('A函数',data)
        }
        function B(...data){
            console.log('B函数',data)
        }
        function C(...data){
             let a=Array.prototype.slice.call(data,0,2)
             let b=Array.prototype.slice.call(data,2)
             console.log(a,b,data)
             A.call(this,a)
             B.call(this,b)
        }
        C(1,2,3,4)
    </script>
</body>

</html>